package testcase.doctor;

import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;


import api.doctor.SubjectCalc;
import common.Host;
import common.TestData;

/**
 * 帮忙医医生端会话统计接口测试用例
 * @author gaowen
 *
 */
public class TestSubjectCalc
{
	/**
	 * 帮忙医医生端会话统计接口SubjectCalc测试环境数据驱动
	 * @return 测试数据
	 * @throws Exception
	 */
	@DataProvider(name="Test")
	public static String[][] testSubjectCalcDataProvider() throws Exception 
	{
		Host.setup("Test");
		TestData td=new TestData("doctor/TestSubjectCalc.xml");
		return td.getParam();
	}
	
	/**
	 * 帮忙医医生端会话统计接口SubjectCalc测试环境测试用例
	 * @param caseName 用例名
	 * @param ID 医生ID
	 * @param Voip 医生voip账号
	 * @param token 调接口需要的token
	 * @throws Exception 
	 */
	@Test(dataProvider="Test",groups="Test")
	public void testSubjectCalcTestCase(String caseName,String ID,String Voip,String token) throws Exception
	{
		String result=SubjectCalc.get(ID, Voip, token);
		
		switch (caseName)
		{
			case "Success":
				Assert.assertNotNull(result);
				break;
			case "IDWrong":
				Assert.assertNotNull(result);
				break;
			case "IDNull":
				Assert.assertNull(result);
				break;
			case "VoipWrong":
				Assert.assertNotNull(result);
				break;
			case "VoipNull":
				Assert.assertNotNull(result);
				break;
			case "TokenWrong":
				Assert.assertNotNull(result);
				break;
			case "TokenNull":
				Assert.assertNotNull(result);
				break;
			default:
				break;
		}
	}
}
